public class ControlPanel {
    private int passwordLength = 4;
    private int wrongPasswordCount = 0;
    private boolean isLocked = false;
    private int lockTime = 0;
    private String inputPassword = "";

    public void setInputPassword(String inputPassword) {
        this.inputPassword = inputPassword;
    }

    public void checkPassword() {
        if (inputPassword.length() == passwordLength) {
            if (inputPassword.equals("1234")) {
                // 密码正确，进入系统功能选择状态
                enterSystemFunctionState();
            } else {
                // 密码错误
                wrongPasswordCount++;
                if (wrongPasswordCount >= 3) {
                    // 锁定控制面板
                    lockControlPanel();
                }
            }
            // 清空输入的密码
            inputPassword = "";
        }
    }

    private void enterSystemFunctionState() {
        // 进入系统功能选择状态
    }

    private void lockControlPanel() {
        isLocked = true;
        lockTime = 120;
    }

    public void unlockControlPanel() {
        isLocked = false;
        lockTime = 0;
    }

    public void decreaseLockTime() {
        if (lockTime > 0) {
            lockTime--;
            if (lockTime == 0) {
                unlockControlPanel();
            }
        }
    }
}